{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body" pad15>
        <div class="layui-form" wid100 lay-filter="">
        <form action="{:request()->url()}" class="layui-form" method="post">
            <table class="layui-table" lay-filter="test">
                <thead>
                <tr>
                    <th>字段名称</th>
                    <th>是否启用</th>
                    <th>列表显示</th>
                    <th>是否必填</th>
                    <th>排序</th>
                </tr>
                </thead>
                <tbody class="addlists">
                {foreach name="$field" key="i" item="v"}
                <tr>
                    <td>
                        <input type="hidden"  name="field[{$i}][id]" value="{$v.id|default=''}" class="layui-input" placeholder="" lay-verify="required">
                        <input type="text"  name="field[{$i}][name]" value="{$v.name|default=''}" class="layui-input" placeholder="" lay-verify="required">
                    </td>
                    <td>
                        <input type="checkbox" name="field[{$i}][is_status]" lay-skin="switch" lay-text="是|否" {if isset ($v.is_status) && $v.is_status =='1'} checked{/if}>
                    </td>
                    <td>
                        <input type="checkbox" name="field[{$i}][is_show]" lay-skin="switch" lay-text="是|否" {if isset ($v.is_show) && $v.is_show =='1'} checked{/if}>
                    </td>
                    <td>
                        <input type="checkbox" name="field[{$i}][is_required]" lay-skin="switch" lay-text="是|否" {if isset ($v.is_required) && $v.is_required =='1'} checked{/if}>
                    </td>
                    <td>
                        <input type="number" name="field[{$i}][sort_order]" value="{$v.sort_order|default='100'}" class="layui-input" placeholder="" lay-verify="required">
                    </td>
                </tr>
                {/foreach}
                </tbody>
            </table>


            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit  lay-filter="*">确认保存</button>
                </div>
            </div>
        </form>
        </div>
    </div>
</div>
{/block}
